<%--
  Created by IntelliJ IDEA.
  User: bi
  Date: 2019/1/3
  Time: 9:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/style.css" />
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.8.3.min.js"></script>

    <script type="text/javascript">
        function page_nav(frm,num){
            frm.pageIndex.value=num;
            frm.submit();
        }
        function getValue(){
            var productName=$("#productName").val();
            if(productName=="null"){
                $("#productName").val("");
            }
        }
    </script>
    <%
        String payStatus="";
        if(request.getParameter("payStatus")!=null)
            payStatus=request.getParameter("payStatus");
    %>
</head>

<body onload="getValue()">
<form method="post" action="/BillServlet?action=fenye">
    <div class="menu">
        商品名称：<input type="text" name="productName" id="productName" class="input-text" value="${name}"/>&nbsp;&nbsp;&nbsp;&nbsp;
        是否付款：<select name="payStatus">
        <option value="">请选择</option>
        <option value="1" <%=(payStatus.equals("1")?"selected":"") %> >已付款</option>
        <option value="0" <%=(payStatus.equals("0")?"selected":"") %> >未付款</option>
    </select>&nbsp;&nbsp;&nbsp;&nbsp;

        <input type="submit" value="组合查询" class="button" />

    </div>
    <div class="main">
        <div class="optitle clearfix">
            <em><input type="button" name="button" value="添加数据" class="input-button" onclick="location.href='/BillServlet?action=show'" /></em>
            <div class="title">账单管理&gt;&gt;</div>
        </div>
        <div class="content">
            <table class="list">
                <tr>
                    <td>账单编号<input type="hidden" name="pageIndex"/></td>
                    <td>商品名称</td>
                    <td>商品数量</td>
                    <td>交易金额</td>
                    <td>是否付款</td>
                    <td>供应商名称</td>
                    <td>商品描述</td>
                    <td>账单时间</td>
                </tr>
                <c:forEach items="${bills}" var="bill">
                    <tr>
                        <td>${bill.id }</td>
                        <td><a href="/BillServlet?action=search&id=${bill.id }">${bill.product_name }</a></td>
                        <td>${bill.counts }</td>
                        <td>${bill.bill_money }</td>
                        <td>${bill.is_pay eq '0'?'未付款':'已付款' }</td>
                        <td>${bill.providername }</td>
                        <td>${bill.product_desc }</td>
                        <td>${bill.bill_time }</td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
</form>

<%@include file="rollPage.jsp"%>
</div>
</body>
</html>
